package com.zjitc.dao;

import com.zjitc.pojo.User;
import org.apache.ibatis.annotations.Param;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/29 15:01
 * @description:
 */
public interface UserDao {

  User findByUsernameAndPassword(
      @Param("username") String username,
      @Param("password") String password
  );

  int isNotUsername(
      @Param("username") String username
  );

  int register(User user);

  int checkEmail(String str);

  User findByUserName(
      @Param("username") String username
  );

  String userQuestion(
      @Param("username") String username
  );

  int checkPassword(String passwordOld);
  int updatePassword(
      @Param("username") String username,
      @Param("passwordNew") String passwordNew
  );


  int updateInformation(
      @Param("username") String username,
      @Param("email") String email,
      @Param("question") String question,
      @Param("answer") String answer,
      @Param("phone") String phone);

  int checkQuestion(
      @Param("username") String username,
      @Param("question") String question
  );

  int checkAnswer(
      @Param("username") String username,
      @Param("answer") String answer
  );
}
